<html>
    <head>
        <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
        <title>3. Miscellaneous</title>
        <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" title="Ref" charset="utf-8"/>
    </head>
    <body class="body">
    <h1><a name="3. Miscellaneous">3. Miscellaneous</a></h1>
<h2><a name="3.1. Configuration">3.1. Configuration</a></h2><div class="code"><pre>grails.plugins.freemarkertags = &#91;
  autoImport: <span class="java&#45;keyword">true</span>,                   /&#42; To enable or to disable auto&#45;<span class="java&#45;keyword">import</span> feature. When disabled the generated libraries can be imported using FreeMarker <span class="java&#45;keyword">default</span> mechanism. &#42;/
  defineLegacyFunctions: <span class="java&#45;keyword">false</span>,       /&#42; To enable or to disable <span class="java&#45;quote">"legacy"</span> (name starting with '_') function declaration/definition feature. &#42;/
  asSharedVariables: <span class="java&#45;keyword">false</span>,           /&#42; EXPERIMENTAL: To expose directives and functions as shared variables, avoiding extra object creation at every template rendering. &#42;/<p class="paragraph"/>  viewResolver: &#91;
     legacyHideExceptions: <span class="java&#45;keyword">false</span>     /&#42; To enable or to disable the <span class="java&#45;quote">"feature"</span> of hiding exceptions thrown by FreeMarkerViewResolver. It will also affect how those exceptions will be logged. &#42;/
  &#93;
&#93;</pre></div><p class="paragraph"/>
<blockquote class="warning">
When using asSharedVariables = true, be aware that some templates can mistakenly/inadvertently "shadow" shared variables definitions.<p class="paragraph"/>Because this feature is still experimental there is no garantee that tags will work in a "Thread safe" way.
</blockquote>
<h2><a name="3.2. Logging">3.2. Logging</a></h2>You can enable plugin activity logging using the namespace 'org.codehaus.groovy.grails.plugins.freemarker'.<p class="paragraph"/>For more information about Grails logging, please consult: <a href="http://grails.org/doc/latest/guide/3.%20Configuration.html#3.1.2%20Logging" target="blank">Grails Logging</a>
<h2><a name="3.4. Reserved words">3.4. Reserved words</a></h2>FreeMarker reserved words present in Grails Core TagLibs that can cause errors to FreeMarker's parser, will be preceded by '_' (underscore).<p class="paragraph"/>.gsp<p class="paragraph"/><div class="code"><pre>&#60;g:renderErrors bean=<span class="java&#45;quote">"$&#123;myUserInstance&#125;"</span> as=<span class="java&#45;quote">"list"</span> /&#62;</pre></div><p class="paragraph"/>
.ftl<p class="paragraph"/><div class="code"><pre>&#60;@g.renderErrors bean=myUserInstance _as=<span class="java&#45;quote">"list"</span> /&#62;</pre></div><p class="paragraph"/>or<p class="paragraph"/><div class="code"><pre>&#91;@g.renderErrors bean=myUserInstance _as=<span class="java&#45;quote">"list"</span> /&#93;</pre></div><p class="paragraph"/>
    </body>
</html>
